<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h2>{{person.name}} -- {{ person.age }}</h2>
    <ul>
      <li>1</li>
      <li>1</li>
      <li>2</li>
    </ul>
    <h3>{{ msg }}</h3>
    <div v-text='msg'></div>
    <div v-text='person.name'></div>
    <div v-html='htmlStr'></div>
    <input type="text" v-model='msg'>
    <button v-on:click='handleClick'>点击</button>
    <button @click='handleClick'>点击@</button>
  </div>
  <script src="./Observer.js"></script>
  <script src="./MVue.js"></script>
  <script>
    var vm = new MVue({
      el: '#app',
      data: {
        person: {
          name: '张三',
          age: 18,
          fav: {
            fav1: 'ad'
          }
        },
        msg: '哈哈哈哈mvvm',
        htmlStr: '<h2>干你俩</h2>',
        arr: [1,2,3]
      },
      methods: {
        handleClick () {
          this.$data.person.name = 'lisi'
          console.log(this);
        }
      }
    })
  </script>
</body>
</html>